<?php
require_once('MainModel.php');

/**
 * Add your description here
 *
 * @author Anh euro
 * @copyright Hipt Group
 * @license http://framework.zend.com/license/new-bsd     New BSD License
 */
 
class Vina_Model_Documents extends MainModel
{

    /**
     * mysql var type int(11)
     *
     * @var int     
     */
    protected $_Id;
    
    /**
     * mysql var type int(11)
     *
     * @var int     
     */
    protected $_TypeDocId;
    
    /**
     * mysql var type int(11)
     *
     * @var int     
     */
    protected $_TypeFoderId;
    
    /**
     * mysql var type int(11)
     *
     * @var int     
     */
    protected $_WhereId;
    
    /**
     * mysql var type varchar(11)
     *
     * @var string     
     */
    protected $_KeyNumber;
    
    /**
     * mysql var type varchar(255)
     *
     * @var string     
     */
    protected $_Title;
    
    /**
     * mysql var type int(11)
     *
     * @var int     
     */
    protected $_Date;
    
    /**
     * mysql var type varchar(255)
     *
     * @var string     
     */
    protected $_Link;
    

    

function __construct() {
    $this->setColumnsList(array(
    'id'=>'Id',
    'type_doc_id'=>'TypeDocId',
    'type_foder_id'=>'TypeFoderId',
    'where_id'=>'WhereId',
    'key_number'=>'KeyNumber',
    'title'=>'Title',
    'date'=>'Date',
    'link'=>'Link',
    ));
}

	
    
    /**
     * sets column id type int(11)     
     *
     * @param int $data
     * @return Vina_Model_Documents     
     *
     **/

    public function setId($data)
    {
        $this->_Id=$data;
        return $this;
    }

    /**
     * gets column id type int(11)
     * @return int     
     */
     
    public function getId()
    {
        return $this->_Id;
    }
    
    /**
     * sets column type_doc_id type int(11)     
     *
     * @param int $data
     * @return Vina_Model_Documents     
     *
     **/

    public function setTypeDocId($data)
    {
        $this->_TypeDocId=$data;
        return $this;
    }

    /**
     * gets column type_doc_id type int(11)
     * @return int     
     */
     
    public function getTypeDocId()
    {
        return $this->_TypeDocId;
    }
    
    /**
     * sets column type_foder_id type int(11)     
     *
     * @param int $data
     * @return Vina_Model_Documents     
     *
     **/

    public function setTypeFoderId($data)
    {
        $this->_TypeFoderId=$data;
        return $this;
    }

    /**
     * gets column type_foder_id type int(11)
     * @return int     
     */
     
    public function getTypeFoderId()
    {
        return $this->_TypeFoderId;
    }
    
    /**
     * sets column where_id type int(11)     
     *
     * @param int $data
     * @return Vina_Model_Documents     
     *
     **/

    public function setWhereId($data)
    {
        $this->_WhereId=$data;
        return $this;
    }

    /**
     * gets column where_id type int(11)
     * @return int     
     */
     
    public function getWhereId()
    {
        return $this->_WhereId;
    }
    
    /**
     * sets column key_number type varchar(11)     
     *
     * @param string $data
     * @return Vina_Model_Documents     
     *
     **/

    public function setKeyNumber($data)
    {
        $this->_KeyNumber=$data;
        return $this;
    }

    /**
     * gets column key_number type varchar(11)
     * @return string     
     */
     
    public function getKeyNumber()
    {
        return $this->_KeyNumber;
    }
    
    /**
     * sets column title type varchar(255)     
     *
     * @param string $data
     * @return Vina_Model_Documents     
     *
     **/

    public function setTitle($data)
    {
        $this->_Title=$data;
        return $this;
    }

    /**
     * gets column title type varchar(255)
     * @return string     
     */
     
    public function getTitle()
    {
        return $this->_Title;
    }
    
    /**
     * sets column date type int(11)     
     *
     * @param int $data
     * @return Vina_Model_Documents     
     *
     **/

    public function setDate($data)
    {
        $this->_Date=$data;
        return $this;
    }

    /**
     * gets column date type int(11)
     * @return int     
     */
     
    public function getDate()
    {
        return $this->_Date;
    }
    
    /**
     * sets column link type varchar(255)     
     *
     * @param string $data
     * @return Vina_Model_Documents     
     *
     **/

    public function setLink($data)
    {
        $this->_Link=$data;
        return $this;
    }

    /**
     * gets column link type varchar(255)
     * @return string     
     */
     
    public function getLink()
    {
        return $this->_Link;
    }
    
    /**
     * returns the mapper class
     *
     * @return Vina_Model_DocumentsMapper
     *
     */

    public function getMapper()
    {
        if (null === $this->_mapper) {
            $this->setMapper(new Vina_Model_DocumentsMapper());
        }
        return $this->_mapper;
    }


    /**
     * deletes current row by deleting a row that matches the primary key
     * 
     * @return int
     */

    public function deleteRowByPrimaryKey()
    {
        if (!$this->getId())
            throw new Exception('Primary Key does not contain a value');
        return $this->getMapper()->getDbTable()->delete('id = '.$this->getId());
    }

}

